
import java.awt.BorderLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class BorderLayoutFrame extends JFrame {
    JButton button1;
    JButton button2;
    JButton button3;
    JButton button4;
    JPanel panel;
    JButton button5;

    public BorderLayoutFrame() {
        button1=new JButton("button1");
        button2=new JButton("button2");
        button3=new JButton("button3");
        button4=new JButton("button4");
        button5=new JButton("button5");
        panel=new JPanel();
        for(int i=0;i<10;i++){
            panel.add(new JButton("button"+i));
        }
        this.add(button1,BorderLayout.NORTH);
        this.add(button2,BorderLayout.SOUTH);
        this.add(button3,BorderLayout.WEST);
        this.add(button4,BorderLayout.EAST);
        this.add(panel,BorderLayout.CENTER);
        
        this.setTitle("BorderLayout Test");
        this.setBounds(0, 0, 600, 400);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setVisible(true);
    }
    
    public static void main(String[] args){
        BorderLayoutFrame myFrame=new BorderLayoutFrame();
    }
    
    
}
